Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enforce minimal encoding #99

Merged
merged 1 commit into from
Feb 4, 2020
Merged

fix: enforce minimal encoding #99

merged 1 commit into from
Feb 4, 2020

Conversation

Stebalien
Copy link
Member

Note: this removes two errors that don't appear to be used by anyone.

Note: this removes two errors that don't appear to be used by anyone.
@Stebalien Stebalien requested a review from Kubuxu February 4, 2020 04:57
buf := make([]byte, 2*binary.MaxVarintLen64+hashlen)
n := binary.PutUvarint(buf, 1)
n += binary.PutUvarint(buf[n:], codecType)
buf := make([]byte, 1+varint.UvarintSize(codecType)+hashlen)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to say, "let's just keep it a static allocation as it gives compiler more freedom" but it is already +hashlen so it doesn't matter.

@Stebalien Stebalien merged commit 72cd3d3 into master Feb 4, 2020
@Stebalien
Copy link
Member Author

Thanks @Kubuxu!

@Stebalien Stebalien deleted the fix/minimal-encoding branch February 4, 2020 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants